<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<style type="text/css">
			div{
				border: 1px #000000 solid;/* 黑色实线 */
			}
			#d1{
				width: 150px;
				height: 150px;
			}
			#d2{
				width:100px ;
				height: 100px;
			}
			#d3{
				width:50px;
				height: 50px;
			}
		</style>
	</head>
	<body>
		<div id="di" >d1
			<div id="d2">d2
				<div id="d3">d3</div>
			</div>
		</div>
		<script type="text/javascript">
			let divs=document.querySelectorAll("div")
			for (var i = 0; i < divs.length; i++) {
				divs[i].addEventListener("click",fun1,true)//是否使用捕获型
				divs[i].addEventListener("click",fun2,false)
			}
			function fun1(){
				console.log(`捕获型${event.currentTarget.id}正在执行`)
			}
			function fun2(){
				console.log(`冒泡型${event.currentTarget.id}正在执行`)
			}
		</script>
	</body>
</html>
